package com.spl.mcm.models;

import com.spl.mcm.models.db.MCMSQLiteHelper;

import android.content.Context;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;

public class MCMDataSource {
	public static final String DATABASE_NAME = "mcm.db";
	private static final int DATABASE_VERSION = 1;
	private SQLiteDatabase db;
	private MCMSQLiteHelper helper;
	private String[] allInterceptsColumn = {MCMSQLiteHelper.TABLE_INTERCEPTS_COLUMN_ID,
											MCMSQLiteHelper.TABLE_INTERCEPTS_COLUMN_NAME,
											MCMSQLiteHelper.TABLE_INTERCEPTS_COLUMN_NUMBER,
											MCMSQLiteHelper.TABLE_INTERCEPTS_COLUMN_INTERCEP_TYPE,
											MCMSQLiteHelper.TABLE_INTERCEPTS_COLUMN_INTERCEP_WAY
											};
	private String[] allCallRecordingsColumn = {MCMSQLiteHelper.TABLE_CALLRECORDING_COLUMN_id,
												MCMSQLiteHelper.TABLE_CALLRECORDING_COLUMN_INTERCEPTID,
												MCMSQLiteHelper.TABLE_CALLRECORDING_COLUMN_TIME
												};
	
	private String[] allSMSRecordingsColumn = {MCMSQLiteHelper.TABLE_SMSRECORDING_COLUMN_ID,
											   MCMSQLiteHelper.TABLE_SMSRECORDING_COLUMN_INTERCEPTID,
											   MCMSQLiteHelper.TABLE_SMSRECORDING_COLUMN_CONTENT,
											   MCMSQLiteHelper.TABLE_SMSRECORDING_COLUMN_TIME
												};
	public MCMDataSource(Context context) {
		helper = new MCMSQLiteHelper(context, DATABASE_NAME, null, DATABASE_VERSION);
	}
	
	public void open() throws SQLException {
		db = helper.getWritableDatabase();
	}
	
	public void close() {
		helper.close();
	}
}
